<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="author" content="wangbo">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- <a href="http://127.0.0.1/index.html">跳转Nginx</a>
  <form action="" method="get"></form> -->
  <script>
    console.log(1);
    // 发送请求到后后台 xml类型的数据
    let xhr =  new XMLHttpRequest(); 
    // 当请求的状态改变的时候,
    xhr.onreadystatechange = function () {
      if(this.readyState == 4 && this.status == 200){
         console.log(2);
        console.log(this.responseText);
	   }
    }    
    // 设置发送的方法和地址
    xhr.open('GET','http://127.0.0.1:4000/query?id=1')

    // 直接发送
    xhr.send()
    console.log(3);


  </script>
</body>

</html>